import { ExpeditionOrderDisplay } from './expeditionOrder';
import { NewFinishedOrders } from './newFinishedOrders';
import { SuspendedOrderItems } from './../newHome/suspendedOrderItems';
import { SuspendedOrderItem } from './../newHome/suspendedOrderItem';
import { SuspendedOrders } from './../newHome/suspendedOrders';
import { SuspendedOrder } from './../newHome/suspendedOrder';
import { DeliverOrders } from './../newHome/deliverOrders';
import { routeModel } from './../setup/index';


export class NewFinishedOrdersService {
    static current = new NewFinishedOrdersService();
    route: routeModel = {
        path: 'newFinishedOrders/:id', component: NewFinishedOrders, title: "设置", url: "newFinishedOrders",//redirectTo
        children: [
        ]
    }
    components = [ExpeditionOrderDisplay, SuspendedOrders, SuspendedOrder, SuspendedOrderItems, SuspendedOrderItem]
    forRoot() {
        function traverse(data) {
            let arr = [];
            arr.push(data.component);
            for (let key in data) {
                if (Array.isArray(data[key])) {
                    data[key].forEach(v => {
                        arr = arr.concat(traverse(v))
                    })
                }
            }
            return arr;
        }
        let components = traverse(this.route);
        return components.concat(this.components);
    }
}